<template>
  <div class="main">
    <top-info></top-info>
    <div class="main-content">
      <div class="main-route" v-if="$route.name !== 'saleList'">
        <el-button
            type="text"
            sizi="mini"
            @click="openOrgPage"
            class="cursor-pointer hover-blue">
          <app-icon iconName="vcloud-peizhishujuyuan"
                    className="main-route__icon"/>
          <span class="main-route__text">组织机构管理</span>
        </el-button>
        <el-button
            type="text"
            sizi="mini"
            @click="openBaseDataPage"
            class="cursor-pointer hover-blue">
          <app-icon iconName="vcloud-peizhishujuyuan"
                    className="main-route__icon"/>
          <span class="main-route__text">基础数据设置</span>
        </el-button>
        <el-button
            type="text"
            sizi="mini"
            @click="openReleteSetting"
            class="cursor-pointer hover-blue">
          <app-icon iconName="vcloud-peizhishujuyuan"
                    className="main-route__icon"/>
          <span class="main-route__text">关联设置</span>
        </el-button>
      </div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
  import TopInfo from "./components/topInfo.vue";
  import { openWin } from "@/utils/tool";

  export default {
    name: "main-page",

    components: {
      TopInfo
    },
    computed: {},
    data: () => ({
      baseDataUrl: "/#/baseData/businessAppList",
      orgUrl: "/#/org/organization/account",
      isBaseDataPageExist: "",
      isOrgPageExist: ""
    }),
    created() {
      //this.mockLogin();
      // this.$alert("sss", "标题名称", {
      //     confirmButtonText: '确定',
      //   callback: action => {

      //   }
      // })
    },
    mounted() {
    },
    watch: {},
    methods: {
      handleCollapse() {
        this.isCollapse = !this.isCollapse;
      },
      openOrgPage() {
        this.isOrgDataPageExist = !!openWin(
            this.orgUrl,
            "基础数据管理",
            40,
            30
        );
      },
      openBaseDataPage() {
        this.isBaseDataPageExist = !!openWin(this.baseDataUrl, "基础数据管理", 40, 30);
      },
      openReleteSetting() {
        alert("这里什么也没有！")
      }
    }
  };
</script>

<style lang="scss" src="../../assets/styles/main/index.scss" scoped></style>